</html>
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <title>明德人才管理系统</title>
  <link rel="stylesheet" href="/layui-v2.6.8/layui/css/layui.css">
  <style>

    .c-gray {
      color: #ccc;
    }

    .c-green {
      color: green;
    }

    .c-red {
      color: red;
    }

    .box {
      display: flex;
      justify-content: center;
    }


  </style>
</head>

<body>
  <div class="layui-layout layui-layout-admin">
    <!-- 头部 -->
    {{include'./Public_documents/header.html'}}

    <!-- 左侧 -->
    {{include'./Public_documents/Left_menu.html'}}

    <div class="layui-body">
      <!-- 内容主体区域 -->
      <h1 style="text-align:center;">回收站</h1>
      <div style="text-align:center;padding:30px;">
          <button id="addBtn" class="layui-btn layui-btn-radius layui-btn-primary">添加文章</button>
      </div>
      <div class="layui-carousel" id="test1">
        <table class="layui-table" lay-even lay-skin="nob">
            <tr>
                <td>序号</td>
                <td>标题</td>
                <td>所属分类</td>
                <td>图片</td>
                <td>作者</td>
                <td>内容</td>
                <td>审核状态</td>
                <td>添加时间</td>
                <td>操作时间</td>
            </tr>
            {{each articles item index}}
            <tr>
                <td>{{index + 1}}</td>
                <td>{{item.title}}</td>
                <td>{{item.name}}</td>
                <td><img src="{{item.img}}" alt=""></td>
                <td>{{item.author}}</td>
                <td><a href="#">查看详情</a></td>
                <td>{{@ item.Audit_status}}</td>
                <td>{{item.add_time | dateFormat 'YYYY-MM-DD'}}</td>
                <td>
    
                    <a href="/delete?id={{item.id}}" 
                    onclick=' confirmDelete(" {{item.id}}")'
                    class="layui-btn layui-btn-sm layui-btn-danger layui-btn layui-btn-radius layui-btn-warm">永久删除</a>
                    <a href="/restore?id={{item.id}}" onclick='return confirm("确定还原吗")' 
                    class="layui-btn layui-btn-xs layui-btn layui-btn-radius layui-btn-warm">还原</a>
                </td>
                {{/each}}
        </table>
          {{include'./Public_documents/bottom.html'}}
        </div>
      
  </div>
    <script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
    <script src="/layui-v2.6.8/layui/layui.js"></script>

    <script>

      document.getElementById('addBtn').onclick = function () {
            location.href = '/add'
        }
        function confirmDelete(id) {

            let result = layer.confirm('确认删除吗', {
                btn: ['是的', '取消'], //按钮
                shadeClose: true,
                shade: [0.3, '#000']
            }, () => {
                //点了是的按钮触发
                location.href = "/delete?id=" + id
            }, () => {
                layer.msg('你取消')
            });


        }

</script>
    </script>
</body>

</html>